package com.tongchengsoft.interceptors;

import java.util.HashMap;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;



/**
 * 
 * 全局过滤器
 * 
 * @author lijh
 * 
 */
public class GlobalInterceptors extends HandlerInterceptorAdapter {

	// 过滤的URL
	public String[] allow_urls;
	
	HashMap<String, Object> hm = null;
	
	public void setAllow_urls(String[] allow_urls) {
		this.allow_urls = allow_urls;
	}

	@Override
	public boolean preHandle(HttpServletRequest request,
			HttpServletResponse response, Object handler) throws Exception {

		request.setAttribute("base_path", request.getContextPath());
		System.out.println("URL =======" + request.getRequestURL() + (request.getQueryString() != null ? "?" + request.getQueryString() : ""));
//		request.setAttribute("jquery_path", SysConfiguration.getString("JQUERYCND"));
//		//客服电话
//		request.setAttribute("cservice_phone", SysConfiguration.getString("CUSTOMER_SERVICE_PHONE"));
//		request.setAttribute("image_url", SysConfiguration.getString("PROJECTROOT"));
//		request.setAttribute("company_name", "修手机");
//		request.setAttribute("randomId", Math.random());
//		//express_name收件人
//		//express_phone手机号
//		//express_address收件地址
//		//RcodeImg
//		request.setAttribute("RcodeImg", SysConfiguration.getString("RCODEIMAGE"));
		return true;
	}
	
}
